package com.maxmlr.net.rpc;

import java.lang.reflect.Proxy;

/**
 * @ClassName TpcClientProxy
 * @Description TODO
 * @Author maxiao
 * @Date 2020/4/4 下午9:18
 * @Version V1.0
 */
public class TpcClientProxy {

    public <T> T clientProxy(Class<T> tClass, String host, int port) {
        return (T) Proxy.newProxyInstance(tClass.getClassLoader(),
                new Class[]{tClass}, new RemoteInvocationHandler(host, port));
    }
}
